package com.niiwoo.civet.user.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Description: 用户上传资料类型枚举
 * @Author:LiJian
 * @Date:2017/6/28
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum UserImgTypeEnum {

    /**
     * 身份证照片
     **/
    IDCARD_IMAGE(Byte.valueOf("1"), "身份证照片"),
    // 子类
    IDCARD_FRONT_IMAGE(Byte.valueOf("11"), "身份证正面照"),
    IDCARD_BACK_IMAGE(Byte.valueOf("12"), "身份证背面照"),
    IDCARD_HAND_IMAGE(Byte.valueOf("13"), "手持身份证正面照");

    private Byte value;
    private String desc;

    public static UserImgTypeEnum enumOf(Byte value) {
        for (UserImgTypeEnum typeEnum : values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("UserImgTypeEnum:" + value);
    }

}
